<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang='en'>
<head>
	<meta charset='utf-8' />
	<title>广溢信息技术有限公司</title>
	<meta content='' name='description' />
	<meta content='' name='author' />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- Bootstrap -->
	<link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet" media="screen">
	<link href="__PUBLIC__/css/font-awesome.min.css" rel="stylesheet" >
	<!--[if IE 7]>
	<link  href="__PUBLIC__/css/font-awesome-ie7.min.css" rel="stylesheet">
	<![endif]-->

	<link href="__PUBLIC__/css/bootstrap-responsive.css" rel="stylesheet">
	<link href="__PUBLIC__/css/test.css" rel="stylesheet">
	<script src="__PUBLIC__/js/jquery.js"></script>
	<script src="__PUBLIC__/js/bootstrap.min.js"></script>
	<script src="__PUBLIC__/js/common.js"></script>
	<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	<script src="__PUBLIC__/js/html5shiv.js"></script>
	<script src="__PUBLIC__/js/respond.min.js"></script>
	<![endif]-->
</head>
<body><div style="padding-left:20px;padding-right:20px;">
		<div class="row-fluid">
			<div class="span12">
<script type="text/javascript">
	function check_password(s) {
		if (s.length < 4) {
			return 0;
		}
		var ls = 0;
		if (s.match(/[a-z]/ig)) {
			ls++;
		}
		if (s.match(/[0-9]/ig)) {
			ls++;
		}
		if (s.match(/(.[^a-z0-9])/ig)) {
			ls++;
		}
		if (s.length < 6 && ls > 0) {
			ls--;
		}
		return ls
	}

	function save(){
		var msg="";
		var vars = $("#form_password").serialize();
		sendAjax("<?php echo U('reset_pwd');?>",vars,function(data){			
			alert(data.info);
			setTimeout("myclose()",200);
		});				
	}


	$(document).ready(function() {
		$("#password").keydown(function() {
			s = $(this).val();
			t = check_password(s);
			if (t == 0) {
				$("#msg").html("密码过短");
				$("#msg").css("color", "red");
			}
			if (t == 1) {
				$("#msg").html("密码强度差");
				$("#msg").css("color", "red");
			}
			if (t == 2) {
				$("#msg").html("密码强度良好");
				$("#msg").css("color", "blue");
			}
			if (t == 3) {
				$("#msg").html("密码强度高");
				$("#msg").css("color", "blue");
			}
		})
		$("#confirm_password").keyup(function() {
			new_pwd = $("#password").val();
			confirm_pwd = $(this).val();
			if (new_pwd != confirm_pwd) {
				$("#msg").html("密码不一致");
				$("#msg").css("color", "red");
			} else {
				$("#msg").html("密码一致");
				$("#msg").css("color", "blue");
				$("#status").val("true");
			}
		})
	})
</script>
<form id="form_password" method="post" action="">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<input type="hidden" name="user_id" id="user_id" value="<?php echo ($id); ?>">
	<div class="popup" >
		<div class="row-fluid title">
			<span>修改密码</span>
		</div>
		<table class="table">
			<tr>
				<th >
					<label for="password">新密码</label>
				</th>
				<td>
					<input type="password" name="password" id="password" value=""  ></td>
			</tr>
			<tr>
				<th>
					<label for="password">确认密码</label>
				</th>
				<td>
					<input type="password" name="confirm_password" id="confirm_password" value=""  />
				</td>
			</tr>
		</table>
		<div class="action">
			<input class="btn default" type="button" value="保存" onclick="save();">
			<input  class="btn" type="button" value="取消" onclick="myclose();"></div>
	</form>
	<span id="msg"></span>
</div></div>
		</div>
	</div>

</body>
</html>